package com.buba.feign;

import common.R;
import entity.salary.dto.AccountDto;
import entity.staff.Accounting;
import entity.staff.Department;
import entity.staff.Post;
import entity.staff.dto.saveAccountDto;
import entity.staff.dto.updateAccSecurityDto;
import entity.staff.dto.withAccumPerDto;
import entity.staff.dto.withSocialPerDto;
import org.springframework.cloud.openfeign.FeignClient;
import org.springframework.web.bind.annotation.GetMapping;
import org.springframework.web.bind.annotation.PostMapping;
import org.springframework.web.bind.annotation.RequestBody;
import utils.PageResult;

import java.util.List;
import java.util.Map;

@FeignClient(name = "staff",path = "/staff")
public interface staffFeign {

    /* *
     * @Author: beisheng
     * @Descriprion: 给员工绑定公积金方案
     * @Date: 2023/3/17 9:42
     * @Return: common.R
     * @Param: [saveAccountDto]
     */

    @PostMapping("/accounting/saveAccountToAccumulation")
    public R saveAccountToAccumulation(@RequestBody saveAccountDto saveAccountDto);

    /* *
     * @Author: beisheng
     * @Descriprion: 给员工绑定社保方案
     * @Date: 2023/3/17 9:42
     * @Return: common.R
     * @Param: [saveAccountDto]
     */

    @PostMapping("/accounting/saveAccountToSocial")
    public R saveAccountToSocial(saveAccountDto saveAccountDto);

    /* *
     * @Author: beisheng
     * @Descriprion: 批量将用户解绑社保方案
     * @Date: 2023/3/17 13:47
     * @Return: void
     * @Param: [ids]
     */

    @PostMapping("/accounting/updateACCScheme")
    void updateACCScheme(List<String> ids);

    /* *
     * @Author: beisheng
     * @Descriprion: 批量将用户解绑公积金方案
     * @Date: 2023/3/17 13:47
     * @Return: void
     * @Param: [ids]
     */

    @PostMapping("/accounting/updateAccumScheme")
    void updateAccumScheme(List<String> ids);

    /* *
     * @Author: beisheng
     * @Descriprion: 再更改方案关联人员的时候给员工解绑或者绑定方案
     * @Date: 2023/3/19 20:28
     * @Return: void
     * @Param: [updateAccSecurityDto]
     */

    @PostMapping("/accounting/updateAccSecurity")
    void updateAccSecurity(updateAccSecurityDto updateAccSecurityDto);

    /* *
     * @Author: beisheng
     * @Descriprion: 再更改方案关联人员的时候给员工解绑或者绑定方案
     * @Date: 2023/3/19 20:28
     * @Return: void
     * @Param: [updateAccSecurityDto]
     */

    @PostMapping("/accounting/updateAccum")
    void updateAccum(updateAccSecurityDto updateAccSecurityDto);

    /* *
     * @Author: beisheng
     * @Descriprion: 根据多个用户id查询用户数据
     * @Date: 2023/3/15 19:55
     * @Return: java.util.List<entity.staff.Accounting>
     * @Param: [splitLiss]
     */

    @PostMapping("/accounting/selstaffByIds")
    List<Accounting> selstaffByIds(List<String> splitLiss);

    /* *
     * @Author: beisheng
     * @Descriprion: 根据社保方案id分页模糊查询关联的人员
     * @Date: 2023/3/16 10:56
     * @Return: java.util.List<entity.staff.Accounting>
     * @Param: [socialPerDto]
     */

    @PostMapping("/accounting/selstaffBySocial")
    PageResult selstaffBySocial(withSocialPerDto socialPerDto);

    /* *
     * @Author: beisheng
     * @Descriprion: 根据公积金方案id分页模糊查询关联的人员
     * @Date: 2023/3/16 10:56
     * @Return: java.util.List<entity.staff.Accounting>
     * @Param: [socialPerDto]
     */

    @PostMapping("/accounting/selstaffByAccum")
    PageResult selstaffByAccum(withAccumPerDto accumPerDto);

    /* *
     * @Author: beisheng
     * @Descriprion: 根据ID查询当前人员部门信息
     * @Date: 2023/3/16 11:28
     * @Return: entity.staff.Department
     * @Param: [id]
     */

    @PostMapping("/department/selNameById")
    Department selNameById(Integer id);

    /* *
     * @Author: beisheng
     * @Descriprion: 根据ID查询当前人员岗位信息
     * @Date: 2023/3/16 11:28
     * @Return: entity.staff.Department
     * @Param: [id]
     */

    @PostMapping("/post/selNameById")
    Post selPostNameById(Integer id);

    /* *
     * @Author: beisheng
     * @Descriprion: 查询当前社保关联的人员是否绑定参保档案
     * @Date: 2023/3/20 13:36
     * @Return: java.util.List<entity.staff.Accounting>
     * @Param: [saId]
     */

    @PostMapping("/accounting/selInsurancefile")
    List<Accounting> selInsurancefile(Integer saId);

    /* *
     * @Author: beisheng
     * @Descriprion: 查询当前公积金关联的人员是否绑定参保档案
     * @Date: 2023/3/20 13:36
     * @Return: java.util.List<entity.staff.Accounting>
     * @Param: [saId]
     */

    @PostMapping("/accounting/selInsurancefiles")
    List<Accounting> selInsurancefiles(Integer saId);

    /* *
     * @Author: beisheng
     * @Descriprion: 修改人员关联社保档案ID
     * @Date: 2023/3/20 14:57
     * @Return: void
     * @Param: [socialId, ozId]
     */
    @PostMapping("/accounting/updateInsuranceFileId")
    void updateInsuranceFileId(Map<String,Integer> map);

    /* *
     * @Author: beisheng
     * @Descriprion: 办理增员
     * @Date: 2023/3/20 19:37
     * @Return: void
     * @Param: [saveAccountDto]
     */

    @PostMapping("/accounting/updateAccSocialAndAccum")
    void updateAccSocialAndAccum(AccountDto saveAccountDto);

    /* *
     * @Author: beisheng
     * @Descriprion: 根据人员ID查询当前人员信息
     * @Date: 2023/3/31 14:06
     * @Return: entity.staff.Accounting
     * @Param: [accId]
     */

    @GetMapping("/accounting/selAccById")
    Accounting selAccById(Integer accId);

    /* *
     * @Author: beisheng
     * @Descriprion: 根据部门名称查询信息
     * @Date: 2023/4/3 9:57
     * @Return: entity.staff.Department
     * @Param: [departmentName]
     */

    @GetMapping("/department/selDepartmentidByName")
    Department selDepartmentidByName(String departmentName);
}
